<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>用户管理</title>
    <link rel="stylesheet" href="../assets/lib/layui/css/layui.css" />
  </head>

  <body>
    <div class="layui-card">
      <!-- 标题 -->
      <div class="layui-card-header">用户列表</div>
      <div class="layui-card-body">
        <!-- 表单 -->
        <form class="layui-form" action="">
          <table class="layui-table">
            <colgroup>
              <col width="50" />
              <col width="180" />
              <col width="150" />
              <col width="150" />
              <col width="180" />
            </colgroup>
            <thead>
              <tr>
                <th>ID</th>
                <th>账号名称</th>
                <th>昵称</th>
                <th>邮箱</th>
                <th>操作</th>
              </tr>
            </thead>
            <tbody>
              <!-- <tr>
                            <td>1</td>
                            <td>admin</td>
                            <td>人fdgfgfgg</td>
                            <td>ssss@qq.com</td>
                            <td>
                                <button type="button" class="layui-btn layui-btn-xs">编辑</button>
                                <button type="button" class="layui-btn layui-bg-red layui-btn-xs">删除</button>
                                <button type="button" class="layui-btn layui-bg-blue layui-btn-xs">重置密码</button>
                            </td>
                        </tr> -->
            </tbody>
          </table>
        </form>
        <div id="page"></div>
      </div>
    </div>
    <!-- 分页 -->
   

    <!-- 用户列表渲染 -->
    <script id="tpl-list" type="text/html">
      {{each data val}}
      <tr>
        <td>{{val.id}}</td>
        <td>{{val.username}}</td>
        <td>{{val.nickname}}</td>
        <td>{{val.email}}</td>
        <td>
          <button
            type="button"
            class="layui-btn layui-btn-xs"
            data-id="{{val.id}}"
          >
            <a href="./edit.html?id={{val.id}}" style="color:#fff">编辑</a>
          </button>
          <button
            type="button"
            class="layui-btn layui-bg-red layui-btn-xs"
            id="del"
            data-id="{{val.id}}"
          >
            删除
          </button>
          <button
            type="button"
            class="layui-btn layui-bg-blue layui-btn-xs"
            data-id="{{val.id}}"
            id="res-pwd"
          >
            重置密码
          </button>
        </td>
      </tr>
      {{/each}}
    </script>

    <!-- 重置密码弹框布局 -->
    <script id="pwd" type="text/html">
      <form
        class="layui-form"
        lay-filter="user"
        id="reset-pwd"
        style="margin:25px"
      >
        <!-- 第一行:新密码 -->
        <div class="layui-form-item">
          <label class="layui-form-label">密码</label>
          <div class="layui-input-block">
            <input
              type="password"
              name="password"
              required
              lay-verify="required|pass"
              placeholder="请输入新密码"
              autocomplete="off"
              class="layui-input "
            />
          </div>
        </div>
        <!-- 第二行:确认新密码 -->
        <div class="layui-form-item">
          <label class="layui-form-label">确认密码</label>
          <div class="layui-input-block">
            <input
              type="password"
              name="password2"
              required
              lay-verify="required|same|pass"
              placeholder="请重复输入新密码"
              autocomplete="off"
              class="layui-input "
            />
          </div>
        </div>
        <!-- 第三行：按钮 -->
        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">
              提交
            </button>
            <button type="reset" class="layui-btn layui-btn-primary">
              重置
            </button>
          </div>
        </div>
      </form>
    </script>

    <script src="../assets/lib/layui/layui.all.js"></script>
    <script src="../assets/lib/jquery.js"></script>
    <script src="../assets/lib/template-web.js"></script>
    <script src="../assets/js/user/user.js"></script>
  </body>
</html>
